/***************************************************************************
 *	@file 		fetion_exception.h
 *	@Author 	baoyu0125@gmail.com
 *	@create		2011-7
 *	@version 	1.0.0
 *	@brief		definition of class fetionException,
 *				class is inherited from std::exception, can receive Varargs
 *	@modify		none
 ***************************************************************************/

#ifndef FETION_EXCEPTION_H
#define FETION_EXCEPTION_H

#include <stdarg.h>
#include <exception>

class fetionException : public std::exception
{
public:
	fetionException() {errmsg[0]=0x00;}
	fetionException(const char *errmsg,...)
	{
		va_list p;
		va_start(p,errmsg);
		vsnprintf(this->errmsg,sizeof(this->errmsg),errmsg,p);
		va_end(p);
	}
	virtual const char *what() const throw()
	{
		return errmsg;
	}
private:
	char errmsg[1024];
};

#endif
